package com.yjd.comm.wal.service;

import java.util.Map;

import com.yjd.comm.base.model.PagerModel;
import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.borrow.dto.AuditSubmitDto;
import com.yjd.comm.borrow.dto.BidSubmitDto;
import com.yjd.comm.system.dto.OperParamDto;
import com.yjd.comm.wal.model.WalProjectFlowModel;

/**
 * <b>description</b>：中间账户持有债权业务接口<br>
 * <b>time</b>：2015-08-19 10:54:55 <br>
 * <b>author</b>：  nmd
 */
public interface IWalProjectFlowService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public WalProjectFlowModel insert(WalProjectFlowModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(WalProjectFlowModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long id) throws Exception;
	
	/**
	 * 待匹配的总金额
	* @return
	* @throws Exception
	* int
	 */
	public double getTotalWaitPrice() throws Exception;
	
	/**
	 * 生成债权
	* @throws Exception
	* void
	 */
	public void generateCreditor(AuditSubmitDto auditSubmitDto, BidSubmitDto bidSubmit, OperParamDto operParamDto) throws Exception;
	
	/**
	 * 后台获取待匹配债权记录分页
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public PagerModel getWalProjectlList(Map<String, Object> param) throws Exception;
	
	/**
	 * 债权到期 资金还给小钱包账户
	 * @param nowTime
	 * @param walProjectFlowModel
	 * @throws Exception
	 *void
	 * @exception
	 * @since  1.0.0
	 */
	public void processWalDebtMaturity(Long nowTime, WalProjectFlowModel walProjectFlowModel) throws Exception;
	
	
	/**
	 * 匹配债权或回收债权的job使用
	* @param paramMap
	* @return int
	 * @throws Exception 
	 */
	public int updateByMap(Map paramMap) throws Exception;
}
